package com.sms.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sms.pojo.Orders;
import com.sms.mapper.OrdersMapper;
import com.sms.service.OrdersService;
import com.sms.util.SqlSessionFactoryUtil;
import lombok.Getter;
import org.apache.ibatis.session.SqlSession;

import java.util.List;

@Getter
public class OrdersServiceImpl extends ServiceImpl<OrdersMapper,Orders> implements OrdersService {

    SqlSession sqlSession=null;
    @Override
    public OrdersMapper getBaseMapper() {
        sqlSession= SqlSessionFactoryUtil.getFactory().openSession(true);
        OrdersMapper mapper = SqlSessionFactoryUtil.getFactory().getConfiguration().getMapper(OrdersMapper.class, sqlSession);
        return mapper;
    }

    @Override
    public List<Orders> listOrders() {
        return this.getBaseMapper().listOrders();
    }

}
